package system

import (
	"github.com/gin-gonic/gin"
	"ruoyi-go/internal/framework/utils/rest"
	"ruoyi-go/internal/web/system/domain"
)

func RegisterSysDeptRouter(g *gin.Engine) {
	g.GET("/depts", func(c *gin.Context) {
		var req domain.SysDept
		if err := c.ShouldBindQuery(&req); err != nil {
			rest.Fail(err).Send(c)
			return
		}
		all := domain.SysDeptModel().List(req)
		rest.Success().WithData(all).Send(c)
	})
}
